package org.corey.share;

import java.io.IOException;
import java.util.Enumeration;

import javax.servlet.http.*;

@SuppressWarnings("serial")
public class CoreyShareServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setCharacterEncoding("UTF-8");
		Enumeration<String> names=req.getParameterNames();
		String result="";
		while(names.hasMoreElements()){
			String name=names.nextElement();
			System.out.println(name);
			System.out.println(req.getParameter(name));
			result=result+"\n"+name+":"+req.getParameter(name);
		}
		resp.setContentType("text/plain");
		resp.setHeader("expires", "0");
		resp.getWriter().println(result);
	}
}
